// 测试
var category = [];
var line = [];
var dom = document.getElementById("container");
var myChart = echarts.init(dom);
myChart.setOption({
	xAxis: {
		type: 'category',
		data: []
	},
	yAxis: {
		type: 'value'
	},
	series: [{
		data: [],
		type: 'line'
	}]
});
 // myChart.showLoading(); // 加载动画
$.ajax({
	url: "http://localhost:8080/Online-student/TaskStudentController/getAllScore",
	type: "get",
	data: {
		sid: 1
	},
	dataType: "json",
	success: function(result) {
		// console.log(result);
		if (result.status == 0) {
			$.each(result.data, function(index,item) {
				category.push(item.taskname);
				line.push(item.score);
			})
			// myChart.hideLoading(); //隐藏加载动画
			myChart.setOption({
				xAxis: {
					data: category
				},
				series: [{
					data: line
				}]
			});
		}
	}
})
